<template>
  <el-card class="content-card">
    <template #header>
      <div class="card-header">
        <h3>今日日程</h3>
      </div>
    </template>
    <div class="schedule-list">
      <div v-for="(item, index) in scheduleData" :key="index" class="schedule-item">
        <div class="schedule-time">{{ item.start_time_format }} - {{ item.end_time_format }}</div>
        <div class="schedule-content">{{ item.content }}</div>
        <el-tag v-if="item.is_urgent" type="danger" size="small" class="urgent-tag">紧急</el-tag>
      </div>
      <div v-if="scheduleData.length === 0" class="no-data">今日暂无日程</div>
    </div>
  </el-card>
</template>

<script setup lang="ts">
  interface ScheduleItem {
    start_time_format: string
    end_time_format: string
    content: string
    is_urgent: boolean
  }

  interface Props {
    scheduleData: ScheduleItem[]
  }

  const props = defineProps<Props>()
</script>

<style scoped lang="scss">
  .content-card {
    margin-bottom: 20px;
  }

  .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .card-header h3 {
    margin: 0;
    font-size: 16px;
    color: #303133;
  }

  .schedule-list {
    padding: 4px 0;
  }

  .schedule-item {
    padding: 8px 12px;
    margin-bottom: 6px;
    background-color: #f5f7fa;
    border-radius: 6px;
    position: relative;
  }

  .schedule-time {
    font-size: 12px;
    color: #909399;
    margin-bottom: 2px;
  }

  .schedule-content {
    font-size: 13px;
    color: #303133;
    line-height: 1.3;
  }

  .urgent-tag {
    position: absolute;
    top: 8px;
    right: 12px;
  }

  .no-data {
    text-align: center;
    padding: 12px 0;
    color: #909399;
    font-size: 13px;
  }
</style>
